Free the path fields.
authorFederico Mena Quintero <federico@ximian.com>
Thu, 22 Jan 2004 02:39:31 +0000 (02:39 +0000)
committerFederico Mena Quintero <federico@src.gnome.org>
Thu, 22 Jan 2004 02:39:31 +0000 (02:39 +0000)
2004-01-21  Federico Mena Quintero  <federico@ximian.com>

* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_finalize):
Free the path fields.

* gtk/gtkfilesystemmodel.c (gtk_file_system_model_finalize): Free
the root_path, reported by <scott@asofyet.org>
(gtk_file_system_model_finalize): Unref the file system.

* gtk/gtkfilefilter.c (filter_rule_free): default:
g_assert_not_reached().
(gtk_file_filter_finalize): Free the filter->name, reported by
<scott@asofyet.org>
(gtk_file_filter_finalize): Free the rules list.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkfilechooserdefault.c
gtk/gtkfilefilter.c
gtk/gtkfilesystemmodel.c

index 78af4485c52434c3d757d979e0c875173ecb66fd..fea1a6df3115e69717afd6fe49119a7ff930229a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2004-01-21  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_finalize):
+       Free the path fields.
+
+       * gtk/gtkfilesystemmodel.c (gtk_file_system_model_finalize): Free
+       the root_path, reported by <scott@asofyet.org>
+       (gtk_file_system_model_finalize): Unref the file system.
+
+       * gtk/gtkfilefilter.c (filter_rule_free): default:
+       g_assert_not_reached().
+       (gtk_file_filter_finalize): Free the filter->name, reported by
+       <scott@asofyet.org>
+       (gtk_file_filter_finalize): Free the rules list.
+
 Wed Jan 21 18:10:40 2004  Jonathan Blandford  <jrb@gnome.org>
 
        * gtk/gtkcolorbutton.c (gtk_color_button_set_color):redraw the
index 78af4485c52434c3d757d979e0c875173ecb66fd..fea1a6df3115e69717afd6fe49119a7ff930229a 100644 (file)
@@ -1,3 +1,18 @@
+2004-01-21  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_finalize):
+       Free the path fields.
+
+       * gtk/gtkfilesystemmodel.c (gtk_file_system_model_finalize): Free
+       the root_path, reported by <scott@asofyet.org>
+       (gtk_file_system_model_finalize): Unref the file system.
+
+       * gtk/gtkfilefilter.c (filter_rule_free): default:
+       g_assert_not_reached().
+       (gtk_file_filter_finalize): Free the filter->name, reported by
+       <scott@asofyet.org>
+       (gtk_file_filter_finalize): Free the rules list.
+
 Wed Jan 21 18:10:40 2004  Jonathan Blandford  <jrb@gnome.org>
 
        * gtk/gtkcolorbutton.c (gtk_color_button_set_color):redraw the
index 78af4485c52434c3d757d979e0c875173ecb66fd..fea1a6df3115e69717afd6fe49119a7ff930229a 100644 (file)
@@ -1,3 +1,18 @@
+2004-01-21  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_finalize):
+       Free the path fields.
+
+       * gtk/gtkfilesystemmodel.c (gtk_file_system_model_finalize): Free
+       the root_path, reported by <scott@asofyet.org>
+       (gtk_file_system_model_finalize): Unref the file system.
+
+       * gtk/gtkfilefilter.c (filter_rule_free): default:
+       g_assert_not_reached().
+       (gtk_file_filter_finalize): Free the filter->name, reported by
+       <scott@asofyet.org>
+       (gtk_file_filter_finalize): Free the rules list.
+
 Wed Jan 21 18:10:40 2004  Jonathan Blandford  <jrb@gnome.org>
 
        * gtk/gtkcolorbutton.c (gtk_color_button_set_color):redraw the
index 78af4485c52434c3d757d979e0c875173ecb66fd..fea1a6df3115e69717afd6fe49119a7ff930229a 100644 (file)
@@ -1,3 +1,18 @@
+2004-01-21  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_finalize):
+       Free the path fields.
+
+       * gtk/gtkfilesystemmodel.c (gtk_file_system_model_finalize): Free
+       the root_path, reported by <scott@asofyet.org>
+       (gtk_file_system_model_finalize): Unref the file system.
+
+       * gtk/gtkfilefilter.c (filter_rule_free): default:
+       g_assert_not_reached().
+       (gtk_file_filter_finalize): Free the filter->name, reported by
+       <scott@asofyet.org>
+       (gtk_file_filter_finalize): Free the rules list.
+
 Wed Jan 21 18:10:40 2004  Jonathan Blandford  <jrb@gnome.org>
 
        * gtk/gtkcolorbutton.c (gtk_color_button_set_color):redraw the
index 78af4485c52434c3d757d979e0c875173ecb66fd..fea1a6df3115e69717afd6fe49119a7ff930229a 100644 (file)
@@ -1,3 +1,18 @@
+2004-01-21  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_finalize):
+       Free the path fields.
+
+       * gtk/gtkfilesystemmodel.c (gtk_file_system_model_finalize): Free
+       the root_path, reported by <scott@asofyet.org>
+       (gtk_file_system_model_finalize): Unref the file system.
+
+       * gtk/gtkfilefilter.c (filter_rule_free): default:
+       g_assert_not_reached().
+       (gtk_file_filter_finalize): Free the filter->name, reported by
+       <scott@asofyet.org>
+       (gtk_file_filter_finalize): Free the rules list.
+
 Wed Jan 21 18:10:40 2004  Jonathan Blandford  <jrb@gnome.org>
 
        * gtk/gtkcolorbutton.c (gtk_color_button_set_color):redraw the
index 1a8f30c94a218d9916aebcb0f074b6ba19c0a57a..6af3934fa515efa28630819c7fe8f6484caf44cc 100644 (file)
@@ -376,6 +376,17 @@ gtk_file_chooser_default_finalize (GObject *object)
   impl->bookmarks_changed_id = 0;
   g_object_unref (impl->file_system);
 
+  /* FIXME: Free impl->filters -- what's the memory management there? */
+
+  if (impl->current_volume_path)
+    gtk_file_path_free (impl->current_volume_path);
+
+  if (impl->current_folder)
+    gtk_file_path_free (impl->current_folder);
+
+  if (impl->preview_path)
+    gtk_file_path_free (impl->preview_path);
+
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
index d17af98f5e758ac02ffc22e437fbb04b0972f23c..826c171937b1cdc49712b5aecf7e942e8576b979 100644 (file)
@@ -34,7 +34,7 @@ typedef struct _FilterRule FilterRule;
 typedef enum {
   FILTER_RULE_PATTERN,
   FILTER_RULE_MIME_TYPE,
-  FILTER_RULE_CUSTOM,
+  FILTER_RULE_CUSTOM
 } FilterRuleType;
 
 struct _GtkFileFilterClass
@@ -125,6 +125,8 @@ filter_rule_free (FilterRule *rule)
       if (rule->u.custom.notify)
        rule->u.custom.notify (rule->u.custom.data);
       break;
+    default:
+      g_assert_not_reached ();
     }
 
   g_free (rule);
@@ -136,6 +138,10 @@ gtk_file_filter_finalize (GObject  *object)
   GtkFileFilter *filter = GTK_FILE_FILTER (object);
 
   g_slist_foreach (filter->rules, (GFunc)filter_rule_free, NULL);
+  g_slist_free (filter->rules);
+
+  if (filter->name)
+    g_free (filter->name);
 
   parent_class->finalize (object);
 }
index e9f6282544b57f979c66a8798455da0e42fc19eb..1d28fd7851452409724d942fbfbc9b701331f8fa 100644 (file)
@@ -256,6 +256,12 @@ gtk_file_system_model_finalize (GObject *object)
   if (model->root_folder)
     g_object_unref (model->root_folder);
 
+  if (model->root_path)
+    gtk_file_path_free (model->root_path);
+
+  if (model->file_system)
+    g_object_unref (model->file_system);
+
   children = model->roots;
   while (children)
     {